package com.example.JavaConcurrent.Project2_CountDownLatchAndCyclicBarrier.CyclicBarrierBegin_3;

import java.util.concurrent.CyclicBarrier;

public class Run {
    public static void main(String[] args) throws InterruptedException {



        CyclicBarrier cbRef = new CyclicBarrier(3);

        MyThread t1  = new MyThread(cbRef);
        t1.start();
        Thread.sleep(500);
        System.out.println(cbRef.getNumberWaiting());
//        System.out.println(cbRef.getParties());

        MyThread t2  = new MyThread(cbRef);
        t2.start();
        Thread.sleep(500);
        System.out.println(cbRef.getNumberWaiting());
//        System.out.println(cbRef.getParties());

        MyThread t3  = new MyThread(cbRef);
        t3.start();
        Thread.sleep(500);
        System.out.println(cbRef.getNumberWaiting());
//        System.out.println(cbRef.getParties());


        MyThread t4  = new MyThread(cbRef);
        t4.start();
        Thread.sleep(500);
        System.out.println(cbRef.getNumberWaiting());
//        System.out.println(cbRef.getParties());

    }
}
